Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed semaphore logic in uart_syslink.c #126

Merged
merged 1 commit into from
Jun 20, 2016
Merged

Fixed semaphore logic in uart_syslink.c #126

merged 1 commit into from
Jun 20, 2016

Conversation

mikehamer
Copy link
Contributor

This should fix two issues:

  1. Sometimes the queues and semaphores weren't initialized before the first interrupt was triggered, and the interrupt tried to push data to a null queue. This has only occurred to me once, and on a warm restart, I'm not sure if it affects cold boots.
  2. The semaphore logic seemed incorrect (eg. uartslkSendDataIsrBlocking wouldn't have blocked). I have now made the logic explicit using two semaphores. It might be overkill since I think there is only one task that calls these functions. But it solves the problem.

Note that this only affects the CF2 (since the file isn't included for the CF1), and I have been flying successfully with the change for the last few days.

Signed-off-by: Mike Hamer [email protected]

This (should?) fix two issues:

1. Sometimes the queues and semaphores weren't initialized before the first interrupt was triggered, and the interrupt tried to push data to a null queue. This occured once on a warm restart, I'm not sure if it affects cold boots.

2. The semaphore logic seemed incorrect (eg. uartslkSendDataIsrBlocking wouldn't have blocked). I have now made this explicit using two semaphores. It might be overkill, I think there is only one task that calls these functions. But it should solve the problem.

Signed-off-by: Mike Hamer <[email protected]>
@mikehamer
Copy link
Contributor Author

The tests failed due to:

Pulling repository docker.io/bitcraze/builder
Get https://registry-1.docker.io/v1/repositories/bitcraze/builder/tags/latest:
dial tcp 54.175.37.127:443: i/o timeout

Which is not an issue with the PR. I have compiled this for CF1 and CF2, and flight tested on CF2.

@ataffanel
Copy link
Member

I am relaunching the build, this should only be transient.

@ataffanel ataffanel merged commit f993b1c into bitcraze:master Jun 20, 2016
@ataffanel
Copy link
Member

This looks great! It seems the solve the occasional crash upon connections. Thanks, it is merged.

@ataffanel ataffanel modified the milestone: next release Jun 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants